package com.example.spindrift.service;

import com.example.spindrift.dao.SysUserNotifMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserNotifService {
    @Autowired
    SysUserNotifMapper sysUserNotifMapper;

    /**
     * 添加一条或多条条通知、用户关联信息
     * @param notifId 通知ID
     * @param userIds　用户ID集合
     * @return
     */
    public Integer insertNotifToUser(Integer notifId,String userIds){
        return sysUserNotifMapper.insertNotifToUser(notifId,userIds);
    }

    /**
     * 阅读消息
     * @param notifId 通知ID
     * @param userId 用户ID
     * @return
     */
    public Integer readNotif(Integer notifId,Integer userId){
        return sysUserNotifMapper.updateReadState(notifId,userId,"2");
    }
}
